home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / uwserver.zip / uwserver.tar / lib / Makefile_4.3 < prev    next >
Makefile  |  1991-01-25  |  2KB  |  67 lines

  1. #! /bin/make -f
  2. #
  3. #    uw library makefile (4.3BSD)
  4. #
  5. # INCDIR names the directory in which header files are located.
  6. # SERVERDIR names the directory containing the server source.
  7. # SERVER_OBJS names the object files derived from sources in SERVERDIR.
  8. # OBJECTS names all of the object files required for the library.
  9. #
  10.  
  11. INCDIR    =    ../h
  12.  
  13. SERVERDIR =    ../server
  14.  
  15. SERVER_OBJS =    $(SERVERDIR)/openpty.o $(SERVERDIR)/uw_env.o
  16.  
  17. OBJECTS    =    uw_cmd.o uw_close.o uw_detach.o uw_fork.o uw_kill.o \
  18.         uw_netadj.o uw_new.o uw_optcmd.o uw_optfn.o uw_options.o \
  19.         uw_perror.o uw_ttype.o \
  20.         uw_rsetopt.o uw_shell.o \
  21.         uw_gvis.o uw_gtype.o uw_gtitle.o uw_gwsize.o uw_gpos.o \
  22.         $(SERVER_OBJS)
  23.  
  24. SOURCES    =    `echo $(OBJECTS) | sed -e 's/\\.o/\\.c/g'`
  25.  
  26. DEFINES    =    `cat ../DEFINES`
  27.  
  28. CFLAGS    =    -O -I$(INCDIR) $(DEFINES)
  29.  
  30. TARGET    =    libuw.a
  31.  
  32. $(TARGET):    $(OBJECTS)
  33.     ar cr $(TARGET) `lorder $(OBJECTS) | tsort`
  34.     ranlib $(TARGET)
  35.     -if [ ! -f uwlib.a ];then ln -s libuw.a uwlib.a;fi
  36.  
  37. $(SERVER_OBJS):
  38.     cd $(SERVERDIR); make `basename $@`
  39.  
  40. lint:
  41.     lint -uhbx -I$(INCDIR) $(DEFINES) $(SOURCES)
  42.  
  43. tags:
  44.     ctags $(SOURCES)
  45.  
  46. depend: 
  47.     $(CC) -M -I$(INCDIR) $(DEFINES) $(SOURCES) | \
  48.     sed -e ':loop' \
  49.         -e 's/\.\.\/[^ /]*\/\.\./../' \
  50.         -e 't loop' | \
  51.     awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
  52.         else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
  53.                else rec = rec " " $$2 } } \
  54.           END { print rec } ' >> makedep
  55.     echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
  56.     echo '$$r makedep' >>eddep
  57.     echo 'w' >>eddep
  58.     cp Makefile Makefile.bak
  59.     ex - Makefile < eddep
  60.     rm eddep makedep
  61.  
  62. clean:
  63.     -rm *.o
  64.  
  65. # DO NOT DELETE THIS LINE (or the following blank line) -- make depend uses it
  66.  
  67.